package com.dingding.api.controller.activity;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.dingding.api.controller.base.BaseController;
import com.dingding.facade.user.service.IUserMessageFacade;
import com.dingding.facde.activity.service.IActivityShowService;

/**
 * @Description:活动相关的控制器
 * @author fengshuonan
 * @date 2016年7月25日 下午3:07:05
 * @version 叮叮搭车
 * @since 2.3.2
 */
@Scope("prototype")
@Controller("activityController")
@RequestMapping("/authorapi/activity")
public class ActivityController extends BaseController {

	@Resource(name = "activityFacade")
	private IActivityShowService activityFacade;
	
	@Resource(name = "userMessageFacade")
	private IUserMessageFacade userMessageFacade;
	
	
	/**
	 * @Description:获取活动列表
	 * @author fengshuonan
	 * @since 2.3.2
	 */
	@RequestMapping(value = "/v1/getActivityList", method = RequestMethod.POST)
	public void getActivityList(HttpServletRequest request, HttpServletResponse response) {
		
		String clientData = super.getClientData(request, response);
		String responseData = this.activityFacade.getActivityList(clientData);
		super.responseData(response, responseData);
	}
	
	
	/**
	 * @Description: 获取系统消息列表
	 * @author fengshuonan
	 * @since 2.3.2
	 */
	@RequestMapping(value = "/v1/getSystemMessageList", method = RequestMethod.POST)
	public void getSystemMessageList(HttpServletRequest request, HttpServletResponse response){
		
		String clientData = super.getClientData(request, response);
		String responseData = this.userMessageFacade.getSystemMessage(clientData);
		super.responseData(response, responseData);
	}
	
	/**
	 * @Description:获取城市对应的模块列表
	 * @author fengshuonan
	 * @since 2.4
	 */
	@RequestMapping(value = "/v1/getCityModules", method = RequestMethod.POST)
	public void getCityModules(HttpServletRequest request, HttpServletResponse response){
		
		String clientData = super.getClientData(request, response);
		String responseData = this.activityFacade.getIndexModuleList(clientData);
		super.responseData(response, responseData);
	}
	
	/**
	 * @Description:获取城市对应的模块列表
	 * @author yuhaiqing
	 * @since 2.4
	 */
	@RequestMapping(value = "/v2/getCityModules", method = RequestMethod.POST)
	public void getCityModule(HttpServletRequest request, HttpServletResponse response){
		
		String clientData = super.getClientData(request, response);
		String responseData = this.activityFacade.getModuleList(clientData);
		super.responseData(response, responseData);
	}
	
}
